<template>
  <el-dialog
    v-if="show"
    v-model="dialog"
    title="司机结算详情"
    class="OrderDetailDialog"
    width="65%"
    :close-on-click-modal="false"
    :before-close="handleClose"
    top="4vh"
  >
    <el-row>
      <el-col :span="24">
        <div class="my_card">
          <div class="header">司机结算基本信息</div>
          <el-row class="elrow">
            <el-col :span="8">
              <div class="title">司机名称</div>
              <span style="word-wrap: break-word">{{ detail.driverName }}</span>
            </el-col>
            <el-col :span="8">
              <div class="title">设备唯一编号</div>
              <span>{{ detail.deviceCode }}</span>
            </el-col>
            <el-col :span="8">
              <div class="title">创建时间</div>
<!--              <span>{{ detail.chargeTimeType == '00' ? '及时充电' : '预约充电' }}</span>-->
              <span style="word-wrap: break-word">{{ detail.createTime }}</span>
            </el-col>
            <el-col :span="8">
              <div class="title">站点名称</div>
              <span>{{ detail.stationName }}</span>
            </el-col>
            <el-col :span="8">
              <div class="title">使用电量</div>
              <span>{{ detail.electricUse + "(kwh)" }}</span>
            </el-col>

          </el-row>
        </div>
<!--        <div class="my_card">-->
<!--          <div class="header">结算信息</div>-->
<!--          <el-row class="elrow">-->
<!--            <el-col :span="6">-->
<!--              <div class="title">总电量</div>-->
<!--              <span>{{ detail.orderNo || '无'  }}</span>-->
<!--            </el-col>-->

<!--          </el-row>-->
<!--          <el-row class="elrow">-->
<!--            <el-col :span="6">-->
<!--              <div class="title">月结算金额</div>-->
<!--               <span>{{detail.stationType || '无'  }}</span>-->
<!--            </el-col>-->
<!--            <el-col :span="6">-->
<!--              <div class="title">总结算金额</div>-->
<!--               <span>{{detail.stationType || '无'  }}</span>-->
<!--            </el-col>-->

<!--          </el-row>-->
<!--        </div>-->
      </el-col>
    </el-row>
  </el-dialog>

</template>

<script lang="ts" setup>
import { reactive, ref, withDefaults } from 'vue'

interface Props {
  show: boolean
  detail: any
}
const dialog = ref(true)
withDefaults(defineProps<Props>(), {
  show: false,
  detail: {},
})
const emit = defineEmits<{
  (event: 'update:show', val: boolean): void
}>()
//弹框关闭
const handleClose = () => {
  emit('update:show', false)
}

const statusCn = (value: number) => {
  let obj: any = {
    1: '未使用',
    2: '已使用',
    3: '已作废',
  }
  return obj[value]
}

const getTypeNum = (value: string) => {
  let obj: any = {
    '00': '分享获得',
  }
  return obj[value]
}

//时间线数据
const activities = reactive([
  {
    content: '该订单已完成',
    timestamp: '18：27',
  },
  {
    content: '司机确认完成充电目标',
    timestamp: '18：26',
  },
  {
    content: '司机确认目标车辆并按订单要求开始充电',
    timestamp: '17：55',
  },
  {
    content: '司机已到达目的地附近开始寻找目标车辆',
    timestamp: '17：30',
  },
  {
    content: '司机已接单，并前往目的地',
    timestamp: '17：20',
  },
  {
    content: '用户发起订单',
    timestamp: '17：10',
  },
])


</script>

<style lang="scss">
.OrderDetailDialog {
  .el-dialog__body {
    padding: 0px 20px 10px;
  }
  .el-timeline {
    padding: 20px;
  }
  .equipmentBox{
      padding: 20px 10px;
      margin: 10px;
      align-items: center;
      box-sizing: border-box;
      background-color: #C4F4DA ;
      display: flex;
      justify-content: space-between;
      border-radius: 10px;
      color: #0E7B5C ;
  }
  .alignCenter{
    display: flex;
    align-items: center;
  }
  .my_card {
    border: 1px solid rgba(220, 221, 221, 1);
    border-radius: 10px;
    // padding: 13px 0;
    margin-bottom: 10px;
    .header {
      color: rgba(16, 16, 16, 1);
      font-size: 16px;
      border-bottom: 1px solid rgba(220, 221, 221, 1);
      padding: 10px 24px;
      font-weight: 600;
    }
    .flexBetween {
      display: flex;
      width: 100%;
      justify-content: space-between;
      .leftTitle {
        width: 70px;
        display: inline-block;
      }
    }
    .price {
      display: inline-block;
      width: 30px;
    }
    .fontBold {
      font-weight: bold;
      color: #333;
      font-size: 15px;
    }
    .elrow {
      // text-align: right;
      border-top: 1px solid rgba(220, 221, 221, 1);
      padding: 10px 24px;
      .title {
        font-weight: 600;
        color: #333;
      }

      .flexBox {
        display: flex;
        align-items: center;
        p {
          margin: 0 10px;
        }
        .remark {
          color: #a7a7b3;
        }
        .el-icon {
          margin-right: 5px;
        }
      }
      .el-col {
        margin-bottom: 10px;
      }
    }
    .elrow:nth-child(2) {
      border-top: none !important;
    }
  }
}
</style>
